{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f60d7baa",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.cluster import KMeans\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\" \n",
    "\n",
    "# 解决坐标轴刻度负号乱码\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 解决中文乱码问题\n",
    "plt.rcParams['font.sans-serif'] = ['Simhei']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a59aacc",
   "metadata": {},
   "source": [
    "### 导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "134f7067",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>12669</td>\n",
       "      <td>9656</td>\n",
       "      <td>7561</td>\n",
       "      <td>214</td>\n",
       "      <td>2674</td>\n",
       "      <td>1338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7057</td>\n",
       "      <td>9810</td>\n",
       "      <td>9568</td>\n",
       "      <td>1762</td>\n",
       "      <td>3293</td>\n",
       "      <td>1776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>6353</td>\n",
       "      <td>8808</td>\n",
       "      <td>7684</td>\n",
       "      <td>2405</td>\n",
       "      <td>3516</td>\n",
       "      <td>7844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>13265</td>\n",
       "      <td>1196</td>\n",
       "      <td>4221</td>\n",
       "      <td>6404</td>\n",
       "      <td>507</td>\n",
       "      <td>1788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>22615</td>\n",
       "      <td>5410</td>\n",
       "      <td>7198</td>\n",
       "      <td>3915</td>\n",
       "      <td>1777</td>\n",
       "      <td>5185</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Channel  Region  Fresh  Milk  Grocery  Frozen  Detergents_Paper  Delicassen\n",
       "0        2       3  12669  9656     7561     214              2674        1338\n",
       "1        2       3   7057  9810     9568    1762              3293        1776\n",
       "2        2       3   6353  8808     7684    2405              3516        7844\n",
       "3        1       3  13265  1196     4221    6404               507        1788\n",
       "4        2       3  22615  5410     7198    3915              1777        5185"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#导入数据\n",
    "data = pd.read_csv('C:/Users/Xl/Desktop/阶段八模块2（作业）/Wholesale customers data.csv')\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "30867086",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 440 entries, 0 to 439\n",
      "Data columns (total 8 columns):\n",
      " #   Column            Non-Null Count  Dtype\n",
      "---  ------            --------------  -----\n",
      " 0   Channel           440 non-null    int64\n",
      " 1   Region            440 non-null    int64\n",
      " 2   Fresh             440 non-null    int64\n",
      " 3   Milk              440 non-null    int64\n",
      " 4   Grocery           440 non-null    int64\n",
      " 5   Frozen            440 non-null    int64\n",
      " 6   Detergents_Paper  440 non-null    int64\n",
      " 7   Delicassen        440 non-null    int64\n",
      "dtypes: int64(8)\n",
      "memory usage: 27.6 KB\n"
     ]
    }
   ],
   "source": [
    "#查看数据缺失值---数据并没有缺失值，数据完整性比较好\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c24eecb7",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.322727</td>\n",
       "      <td>2.543182</td>\n",
       "      <td>12000.297727</td>\n",
       "      <td>5796.265909</td>\n",
       "      <td>7951.277273</td>\n",
       "      <td>3071.931818</td>\n",
       "      <td>2881.493182</td>\n",
       "      <td>1524.870455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.468052</td>\n",
       "      <td>0.774272</td>\n",
       "      <td>12647.328865</td>\n",
       "      <td>7380.377175</td>\n",
       "      <td>9503.162829</td>\n",
       "      <td>4854.673333</td>\n",
       "      <td>4767.854448</td>\n",
       "      <td>2820.105937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>55.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3127.750000</td>\n",
       "      <td>1533.000000</td>\n",
       "      <td>2153.000000</td>\n",
       "      <td>742.250000</td>\n",
       "      <td>256.750000</td>\n",
       "      <td>408.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>8504.000000</td>\n",
       "      <td>3627.000000</td>\n",
       "      <td>4755.500000</td>\n",
       "      <td>1526.000000</td>\n",
       "      <td>816.500000</td>\n",
       "      <td>965.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>16933.750000</td>\n",
       "      <td>7190.250000</td>\n",
       "      <td>10655.750000</td>\n",
       "      <td>3554.250000</td>\n",
       "      <td>3922.000000</td>\n",
       "      <td>1820.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>112151.000000</td>\n",
       "      <td>73498.000000</td>\n",
       "      <td>92780.000000</td>\n",
       "      <td>60869.000000</td>\n",
       "      <td>40827.000000</td>\n",
       "      <td>47943.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Channel      Region          Fresh          Milk       Grocery  \\\n",
       "count  440.000000  440.000000     440.000000    440.000000    440.000000   \n",
       "mean     1.322727    2.543182   12000.297727   5796.265909   7951.277273   \n",
       "std      0.468052    0.774272   12647.328865   7380.377175   9503.162829   \n",
       "min      1.000000    1.000000       3.000000     55.000000      3.000000   \n",
       "25%      1.000000    2.000000    3127.750000   1533.000000   2153.000000   \n",
       "50%      1.000000    3.000000    8504.000000   3627.000000   4755.500000   \n",
       "75%      2.000000    3.000000   16933.750000   7190.250000  10655.750000   \n",
       "max      2.000000    3.000000  112151.000000  73498.000000  92780.000000   \n",
       "\n",
       "             Frozen  Detergents_Paper    Delicassen  \n",
       "count    440.000000        440.000000    440.000000  \n",
       "mean    3071.931818       2881.493182   1524.870455  \n",
       "std     4854.673333       4767.854448   2820.105937  \n",
       "min       25.000000          3.000000      3.000000  \n",
       "25%      742.250000        256.750000    408.250000  \n",
       "50%     1526.000000        816.500000    965.500000  \n",
       "75%     3554.250000       3922.000000   1820.250000  \n",
       "max    60869.000000      40827.000000  47943.000000  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Fresh列到Delicassen列的数据数量级大小差别很大，在聚类前需要进行标准化\n",
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1e674ec7",
   "metadata": {},
   "source": [
    "### 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "bfaaf740",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.70833271, 0.53987376, 0.42274083, 0.01196489, 0.14950522,\n",
       "        0.07480852],\n",
       "       [0.44219826, 0.61470384, 0.59953989, 0.11040858, 0.20634248,\n",
       "        0.11128583],\n",
       "       [0.39655169, 0.5497918 , 0.47963217, 0.15011913, 0.2194673 ,\n",
       "        0.48961931],\n",
       "       ...,\n",
       "       [0.36446153, 0.38846468, 0.7585445 , 0.01096068, 0.37223685,\n",
       "        0.04682745],\n",
       "       [0.93773743, 0.1805304 , 0.20340427, 0.09459392, 0.01531   ,\n",
       "        0.19365326],\n",
       "       [0.67229603, 0.40960124, 0.60547651, 0.01567967, 0.11506466,\n",
       "        0.01254374]])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#在此使用Normalizer---使用方法同MinMaxScaler、StandardScaler\n",
    "from sklearn.preprocessing import Normalizer\n",
    "data_ = np.array(data)\n",
    "normalizer = Normalizer().fit(data_[:,2:8])\n",
    "X = normalizer.transform(data_[:,2:8])\n",
    "X"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4dcdd768",
   "metadata": {},
   "source": [
    "### 使用轮廓系数找到最优K"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6773b016",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1e04d400be0>]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.lines.Line2D at 0x1e029f2b7c0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD2CAYAAADcUJy6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zL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QA26oZVkAdfXMcqmsAcKWIfCYiL4tIk3zRSnU9gqoZVkATnrMAa3LkfInIxcB+fD+oq1NAE7+/IKC6nDhfgRxzEPA39a3kmIvv7vZwqKs/cL6IfCoi74pISjVjgk4C6M9FkN9jERPwx4nIeUALVV1QzdMB9c1xoK5FwA9UdSC+u3x/2IR1Ve0RVFWTn7MAamry8+WfWrsPGF/LMCfOVSB1OfH+CuSYTvz/GEhda4BLVPVCYB4wugnqggD6cxHkcxZRAS8iLYGngDE1DNnHyX/GJtNEf78A6vpKVbf4H68Cmuyf9upzF747iy+vZkiTn7MAanLifI0HnlHV0lrGOPH+CqQuJ85XIMd04nwFUtcafK1UahsTCucCE/w3i04HLqpmTFDPWcQEvP9KZhbwW1Wtqa/N8b454OubszZM6pomInki4gWupMqdwCGs7TcicpP/j2n4rmiqatJzFmBNTpyvwcBdIjIP6CUiE6sZ0+TvrwDrcuJ8BXJMJ85XIHU9BBz/kPOaGsaEQiD9uYJ7zlQ1In4BdwK78f2Tah7wR+DBKmNS8P3HehxYCaSGSV09gK+AZfi6ajbVOWsBfAB8AjyL7wNOR89ZgDU5cr4qHX8ekOP0uapHXU1+vqoeE2gJTKwyxgP8C/gLviaFHcKkrjbAF/j6Zr0AxDbROWsOvOZ/788HLgj1e8x1d7KKSAt8fXE+Ud8/hUwd7JwFzs5V/YhIAvAjYLGqrnG6nkgQzPeY6wLeGGOMT8TMwRtjjKkfC3hjjHEpC3hjjHEpC3hjjHEpC3hjjHGp/w9dDy4Wsa29CAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.cluster import KMeans \n",
    "from sklearn.metrics import silhouette_score #轮廓系数\n",
    "score=[]\n",
    "\n",
    "#将k值从2变化到20\n",
    "for i in range(2,7):\n",
    "    cluster= KMeans(n_clusters=i, random_state=0).fit(X)\n",
    "    score.append(silhouette_score(X,cluster.labels_))\n",
    "                 \n",
    "plt.plot(range(2,7),score)\n",
    "#给k最大的位置加虚线   #idxmax()[] 取最大索引  因为这边从k=2开始 所以+2\n",
    "plt.axvline(pd.DataFrame(score).idxmax()[0]+2,ls=':')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "679db58b",
   "metadata": {},
   "source": [
    "### 建模及可视化分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "fb6ddfbe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KMeans(n_clusters=2, random_state=0)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k_means = KMeans(n_clusters=2, random_state=0).fit(X)\n",
    "k_means.fit(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4964fad9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.264083</td>\n",
       "      <td>0.479221</td>\n",
       "      <td>0.661907</td>\n",
       "      <td>0.134295</td>\n",
       "      <td>0.251450</td>\n",
       "      <td>0.105409</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.869573</td>\n",
       "      <td>0.174954</td>\n",
       "      <td>0.226061</td>\n",
       "      <td>0.224904</td>\n",
       "      <td>0.050075</td>\n",
       "      <td>0.074002</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Fresh      Milk   Grocery    Frozen  Detergents_Paper  Delicassen\n",
       "0  0.264083  0.479221  0.661907  0.134295          0.251450    0.105409\n",
       "1  0.869573  0.174954  0.226061  0.224904          0.050075    0.074002"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centroid = k_means.cluster_centers_\n",
    "cent = pd.DataFrame(data = centroid,columns = ['Fresh','Milk','Grocery','Frozen','Detergents_Paper','Delicassen'])\n",
    "cent"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f35b0772",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([<matplotlib.patches.Wedge at 0x1e04d521790>,\n",
       "  <matplotlib.patches.Wedge at 0x1e04d5320a0>],\n",
       " [Text(-0.13568303086551883, 1.0915997962326427, '1'),\n",
       "  Text(0.13568323527141382, -1.0915997708254992, '2')],\n",
       " [Text(-0.07400892592664662, 0.5954180706723504, '53.9%'),\n",
       "  Text(0.07400903742077117, -0.5954180568139086, '46.1%')])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1e04d4ef490>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfHUlEQVR4nO3de3hU1b038O/ae/bc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P7W/T69cf1dvru7mCT9civwfzqW/HaJJneFA4h1FlqeIFMB3mVinTYP7HZgB6AHQiPvzNdzHHohK5pLRQGjPCwwryXawgx8EKlCRdptENbnTH0NHUY3xyuMM4trvZOLalXu+O6fACsAPgAI7ADORHAJpp2Dr8KJxJEr9VbRyACQBmAZgCc/grwexZe2Fepjn5D+LLZVmlBXJBSQ4rGJUlFWQ7kOWQmcNhg9MuM4ddhtMuw6FIcAzseA3OuW5A0zm0+EdVM6D1qbynK8q7jvfzrvYI76rv4h2HOoz2A21Gn86RBfNGdA7zB0gTgL0A9gM4kG4bNqcCCqcg8Q3IxgDwAZgBM7hF8T/mMIOrwtxapR/monwdA8J7AgOQ52IOAOiJcTWm49RhJoPZAzriL2f8c0b8YxRALcwwfgxzqJox24FYFYXTQuKBzQNQEH+NBVACYAQANwBX/Es5ThPSU7ABHzmALgCtMCdw6mEupGiHeS58nM4brYfCmULiCyHsMHu+gb2gBLNnPXFJQzvlFa2uVXURNZPzR+EkxKJS/iljhKQrm+gCiFiMsRyYi9JtMC/x3MQ5j4mtigDUcxJzJ8Jfc84vh7m44CrB9ZA46jkzHOf89wN+W4T4PatEPOo5CQCAMTYfQB7nfJPoWoiJZmsJGGP5AN4E8BXO+VHR9RAT9ZwZjjFmh3lD9P+hYFoLhZN8E8AcAPcxxtYxxm4SXRAx0bCWEIuinpMQi6JwEmJRFE5CLIrCSYhFUTgJsSgKJyEWReEkxKIonIRYFIWTEIuicBJiURROQiyKwkmIRVE4CbEoCichFkXhJMSiKJyEWNR/A/CnttJpJoG4AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘制饼状图\n",
    "# 解决中⽂字体乱码的问题\n",
    "x1 = centroid[:1,:].sum()\n",
    "x2 = centroid[1:3,:].sum()\n",
    "labels =[1,2] # 标签\n",
    "percent = [x1,x2]\n",
    "\n",
    "# 绘制饼图：autopct显示百分⽐，这⾥保留⼀位⼩数；shadow控制是否显示阴影\n",
    "plt.pie(x = percent, # 数据\n",
    "labels=labels, # 显示标签\n",
    "autopct='%0.1f%%', # 显示百分⽐\n",
    "shadow=True) # 阴影，3D效果\n",
    "plt.legend()#图例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7434a75b",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 2 artists>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "([<matplotlib.axis.XTick at 0x1e04d503400>,\n",
       "  <matplotlib.axis.XTick at 0x1e04d503430>],\n",
       " [Text(0.3, 0, '0'), Text(1.3, 0, '1')])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1e04d580340>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD2CAYAAAAksGdNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90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eKpWgCeERAtF0/VAvCMZZaWa5N4qhaARzw01ILxVC0ArwhzAHAAa+YA4ADCHAAcQJgDgAMIcwBwAGEOAA74f+lcqhWFO+4hAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘制条形图\n",
    "x = np.arange(2)\n",
    "y1 = np.array(cent.Fresh)\n",
    "y2 = np.array(cent.Milk)\n",
    "y3 = np.array(cent.Grocery)\n",
    "y4 = np.array(cent.Frozen)\n",
    "y5 = np.array(cent.Detergents_Paper)\n",
    "y6 = np.array(cent.Delicassen)\n",
    "\n",
    "bar_width = 0.15\n",
    "tick_label=[0,1]\n",
    "\n",
    "plt.bar(x,y1,bar_width,color=\"c\",align=\"center\",label='Fresh',alpha=0.5)\n",
    "plt.bar(x+bar_width,y2,bar_width,color=\"b\",align=\"center\",label=\"Milk\",alpha=0.5)\n",
    "plt.bar(x+bar_width*2,y3,bar_width,color=\"m\",align=\"center\",label=\"Grocery\",alpha=0.5)\n",
    "plt.bar(x+bar_width*3,y4,bar_width,color=\"y\",align=\"center\",label=\"Frozen\",alpha=0.5)\n",
    "plt.bar(x+bar_width*4,y5,bar_width,color=\"r\",align=\"center\",label=\"Detergents_Paper\",alpha=0.5)\n",
    "plt.bar(x+bar_width*5,y6,bar_width,color=\"k\",align=\"center\",label=\"Delicassen\",alpha=0.5)\n",
    "\n",
    "plt.xticks(x+bar_width*2,tick_label)\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9057f8e0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
